package com.hamster.crmpre.web;

import com.hamster.crmpre.config.LoginInterceptor;
import com.hamster.crmpre.pojo.ExecutivePerformance;
import com.hamster.crmpre.pojo.UserInfo;
import com.hamster.crmpre.service.ExecutivePerformanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：Lizhipeng
 * @date ：Created in 2019/12/25 11:21
 * @description：主管业绩控制器
 * @modified By：
 * @version: 1.0
 */
@RestController
@RequestMapping("executivePerformance")
public class ExecutivePerformanceController {

    @Autowired
    private ExecutivePerformanceService executivePerformanceService;

    /**
     * 查询主管业绩信息的请求处理
     * @return 主管业绩信息
     */
    @RequestMapping("list")
    public ResponseEntity<List<ExecutivePerformance>> list(){
        UserInfo loginUser = LoginInterceptor.getLoginUser();
        String userId =loginUser.getUserId();
        List<ExecutivePerformance> executivePerformanceList = executivePerformanceService.list(userId);
        return ResponseEntity.ok(executivePerformanceList);
    }

}
